package cn.xsly.ymcc.service.impl;

import cn.xsly.ymcc.domain.UserAccount;
import cn.xsly.ymcc.mapper.UserAccountMapper;
import cn.xsly.ymcc.service.IUserAccountService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author whale
 * @since 2022-10-19
 */
@Service
public class UserAccountServiceImpl extends ServiceImpl<UserAccountMapper, UserAccount> implements IUserAccountService {

    @Override
    public void save(Long userId) {

        UserAccount userAccount = new UserAccount();
        userAccount.setCreateTime(new Date().getTime());
        userAccount.setFrozenAmount(new BigDecimal("0"));
        userAccount.setUsableAmount(new BigDecimal("0"));
        userAccount.setId(userId);

        insert(userAccount);
    }
}
